<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<ul>
				<!-- items:表示数据源(提供数据的数组)
				     item:数组中迭代出来元素的变量-->
				<li v-for="(item,index) in items" :key="item.id">
					{{index}}--{{item.message}}
				</li>
				
			</ul>
			<hr>
			<div v-if='value==22'  v-for='(value,key,index) in user'>
				{{value+'----'+key+'-----'+index}}
			</div>
			<hr>
			<p v-for="(v,i) in address">
				{{v}}
			</p>
			  
		</div>
		<script>
			let vm=new Vue({
				el:'#app',
				data:{
				  items:[
					  {id:1,message:'java'},
					  {id:2,message:'c++'},
					  {id:3,message:'python'},
					  {id:4,message:'php'}
				  ]	,
				  user:{
					  username:'haoren',
					  age:22,
					  gender:"F"
				  },
				  address:[
					  '长沙','湘潭','浏阳'
				  ]
				},
				methods:{
					
				}
			});
		</script>
	</body>
</html>
